import axios from 'common/js/axios';
import singerList from '@/common/js/singerList';

// 获取歌手列表
export function getSingerList() {
  let data = { limit: 10 };
  return axios.get('/top/artists', { params: data }).then((res) => {
    let data = [];
    res.artists.forEach((item) => {
      let obj = {};
      obj['id'] = item['id'];
      obj['name'] = item['name'];
      obj['avatar'] = item['img1v1Url'];
      data.push(obj);
    });
    singerList['hot'] = {};
    singerList['hot']['title'] = '热门';
    singerList['hot']['items'] = data;
    return singerList;
  });
}

// 获取歌手详情
export function getSingerDetail(id) {
  let data = { id };
  return axios.get('/artists', { params: data });
}
